home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13577 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: cypher.3do.com!user
  2. From: tsw@3do.com (Tom Watson)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: File problem with Watcom C/C++ 10.5
  5. Date: Mon, 08 Apr 1996 18:57:23 -0800
  6. Organization: The 3DO Corporation
  7. Distribution: world
  8. Message-ID: <tsw-0804961857230001@cypher.3do.com>
  9. References: <4k9fds$4fs@sparcserver.lrz-muenchen.de>
  10. NNTP-Posting-Host: cypher.3do.com
  11.  
  12. In article <4k9fds$4fs@sparcserver.lrz-muenchen.de>, Ralph Reichart
  13. <reichart@informatik.tu-muenchen.de> wrote:
  14.  
  15. > hi,
  16. > i have a big problem. i'm trying to open a file with fopen. the program 
  17. > looks like this:
  18. > #include <stdlib.h>
  19. > #include <stdio.h>
  20. > main()
  21. > {
  22. >  FILE *Datei;
  23. >  Datei = fopen("\autoexec.bat", "r");
  24.  
  25. ANSI defines '\a' as the "alert" character (probably control-G, or a bell).
  26. You are trying to use some silly MS-DOSism.  Perhaps you should try to use
  27. forward slashes '/' which are translated into path seperators somewhere
  28. below the 'fopen' call.
  29.  
  30. >  if (Datei == NULL)
  31. >  {
  32. >   printf("\nSHIT!!");
  33. >   exit(1);
  34. >  };
  35. >  fclose(Datei);
  36. > }
  37. > i'm sorry, but i can't open it. i always have the value -1 or 1 in errno.
  38. > yes, the file exists, but it doesn't matter. it never works.
  39. > can somebody please help me??
  40. > ralphy
  41.  
  42. -- 
  43. Tom Watson
  44. tsw@3do.com         (Home: tsw@johana.com)
  45.